[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
SUBSTR
. Summary
substr(str <source>, int <pos>, int <max>, str <target>);
. Description
The substr function copies a portion of one string to another. Char-
acters from position <pos> in string <source> are copied until into
string <target> (note that SALT string offsets start at 0, not 1 as
in some languages). Characters are copied until a 0 (NULL) value is
encountered (normally at the end of every string), or <max> char-
acters are copied. A 0 (NULL) is always copied at the end of the
target string. The 0 does not count as part of the <max>. Only as
many characters as will fit in <target> are copied.
. Return Value
None.
. Example
str s[] = "horse cat dog", s2;
substr(s, 6, 3, s2);
if (s2 == "cat")
prints("This will always be printed");
See Also:
subchrs
copystr
copychrs
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson